package com.nidu.demo.online;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.nidu.demo.online.dto.OnlineUserDetailCO;
import com.nidu.demo.online.dto.OnlineUserPageQry;
import com.nidu.demo.online.dto.OnlineUserStatisticsCO;
import com.nidu.demo.online.api.OnlineUserService;
import com.nidu.demo.online.executor.query.OnlineUserPageQryExe;
import com.nidu.demo.online.executor.query.OnlineUserSingleQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 在线用户服务实现类
 *
 * @author auto
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class OnlineUserServiceImpl implements OnlineUserService {

    private final OnlineUserSingleQryExe singleQryExe;
    private final OnlineUserPageQryExe pageQryExe;

    @Override
    public SingleResponse<OnlineUserStatisticsCO> getOnlineUserStatistics() {
        return singleQryExe.getOnlineUserStatistics();
    }

    @Override
    public PageResponse<OnlineUserDetailCO> pageOnlineUsers(OnlineUserPageQry qry) {
        return pageQryExe.pageOnlineUsers(qry);
    }

}
